module AutoBase
	module ClassMethods
		def aw_accessor(name)
      class_eval %Q{
        def #{name}(seq = nil)
          @sequence_#{name} ||= {}
          @sequence_#{name}[seq] ||= AutoBase::Sequence.new
        end
      }
    end
	end

	module InstanceMethods
    attr_accessor :session

    ##
    # 调用ActonWord，支持模式
    #   :apply => true
    def action_word(param = {})
      @action_word ||= AutoBase::ActionWord.new(self)
      @action_word
    end

    def session
      @session ||= AutoBase::Session::Echo.new
    end

    def view

    end
	end

	def self.included(receiver)
		receiver.extend         ClassMethods
		receiver.send :include, InstanceMethods
	end
end